<template>
  <el-dialog title="历史记录" :visible.sync="openWarehouseInDetailHistory" width="1200px" append-to-body :destroy-on-close="true" :before-close="beforeClose">
    <el-table
      v-loading="loading"
      :data="warehouseHistoryRecord"
    >
      <af-table-column prop="namep" label="操作人" align="center" class-name="small-padding fixed-width"  fixed="left"></af-table-column>
      <af-table-column prop="rqid" label="操作时间"  fixed="left"></af-table-column>
      <af-table-column prop="action" label="操作内容" ></af-table-column>
      <af-table-column prop="spzs" label="物品规格" ></af-table-column>
      <af-table-column prop="spcd" label="品牌" ></af-table-column>
      <af-table-column prop="spgh" label="柜号" ></af-table-column>
      <af-table-column prop="spbh" label="批号" ></af-table-column>
      <af-table-column prop="spjsl" label="单重" ></af-table-column>
      <af-table-column prop="spjs" label="件数" ></af-table-column>
      <af-table-column prop="spsl" label="重量" ></af-table-column>
      <af-table-column prop="spckmc" label="仓库" ></af-table-column>
      <af-table-column prop="ckcw" label="仓位" ></af-table-column>
      <af-table-column prop="itbz" label="备注"  width="150" :show-overflow-tooltip="true"></af-table-column>
      <af-table-column prop="ssrqid" label="入仓日期" ></af-table-column>
      <af-table-column prop="wpggA" label="纱支" ></af-table-column>
      <af-table-column prop="wpggB" label="工艺" ></af-table-column>
      <af-table-column prop="wpggC" label="工序" ></af-table-column>
      <af-table-column prop="wpggD" label="用途" ></af-table-column>
      <af-table-column prop="wpggE" label="产地" ></af-table-column>
      <af-table-column prop="wpggF" label="漂染性" ></af-table-column>
      <af-table-column prop="wpggG" label="生产日期" ></af-table-column>
      <af-table-column prop="wpggH" label="颜色" ></af-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
import { warehouseInHistoryRecord } from "@/api/storage/commonGoods/warehouseIn";

export default {
  name: "WarehouseInDetailHistory",
  data() {
    return {
      // 显示搜索条件
      showSearch: true,
      //表格加载
      loading: true,
       //弹窗状态
      openWarehouseInDetailHistory: false,
      formQuery:{
        spdzid:"" 
      },
      warehouseHistoryRecord:[]
    };
  },
  methods: {
    /**获取仓库信息 */
    getList() {
      this.loading = true
      warehouseInHistoryRecord(this.formQuery).then(response => {
        this.warehouseHistoryRecord = response.data;
        this.loading = false
      });
    },
    /**改变窗口状态 */
    changeWarehouseInDetailHistory() {
      this.openWarehouseInDetailHistory = !this.openWarehouseInDetailHistory;
    },
    /**关闭弹窗 */
    beforeClose(done) {
      this.changeWarehouseInDetailHistory()
      done()
    },
    /**打开弹窗 */
    open(row) {
      this.changeWarehouseInDetailHistory(row)
      this.formQuery.spdzid = row.dzid
      this.getList()
    }
  }
};
</script>
